#include "../../include/graphics/Color.hpp"
using namespace klas;
using namespace graphics;

Color::Color()
{
  Color(1.0, 1.0, 1.0, 1.0);
}

Color::Color(double r, double g, double b, double a)
{
  // Make sure the colors are positive.
  r < 0.0 ? r = 0.0 : false;
  g < 0.0 ? g = 0.0 : false;
  b < 0.0 ? b = 0.0 : false;
  a < 0.0 ? a = 0.0 : false;

  // Make sure the colors are below from zero to one.
  r > 1.05 ? r /= 255.0 : false;
  g > 1.05 ? g /= 255.0 : false;
  b > 1.05 ? b /= 255.0 : false;
  a > 1.05 ? a /= 255.0 : false;

  // Set the colors.
  this->r = r,
  this->g = g,
  this->b = b,
  this->a = a;
}